	    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
		<script type="text/javascript">
		 
			// Load google visualization API
			google.load('visualization', '1', {packages: ['table','columnchart']});
			// On load call draw function
 		  	google.setOnLoadCallback(drawVisualization);
 		  	
			function drawVisualization() {
	            // In case of portfolio competition
				{% if not compType %}
				var visualization;
				
	            // Portfolio ranking table
				var data = new google.visualization.DataTable();
				data.addColumn('string', 'User Name');
		        data.addColumn('number', 'Change Rate');
				{{ table_users_Text }}
				visualization = new google.visualization.Table(document.getElementById('table'));
				visualization.draw(data, {'allowHtml':true,'width':350,'page':'enable','sortColumn':1,'sortAscending':false});
				{% endif %}

	            // In case of arena competition
				{% if compType %}
				var visualization2;
				
	            // Arena ranking table	 
				var data3 = new google.visualization.DataTable();
				data3.addColumn('string', 'Arena Entities');
				{% if showArenaAction %}
		        data3.addColumn('string', 'Action');
				{% else %}
				data3.addColumn('number', 'Change Rate');
				{% endif %}
				data3.addColumn('string', 'Users');
				{{ entities_Text }}

				visualization2 = new google.visualization.Table(document.getElementById('table_entities'));
				visualization2.draw(data3, {'allowHtml':true,'width':350,'page':'enable','sortColumn':1,'sortAscending':false});
				{% endif %}
				
				// If competition started, show chart div with progress
				{% if not compInfoMsg %}
	            // Competition chart div 
				var data2 = new google.visualization.DataTable();
				data2.addColumn('string', 'User');
				data2.addColumn('number', '% Change');
				{{ column_users_Text }}
				var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
				chart.draw(data2, {'allowHtml':true,width: 400, height: 240, is3D: true, title: 'Competition Current Rankings','sortColumn':1,'sortAscending':false});
				{% endif %}
			}


		  		  
		 // JQuery Code
		$(document).ready(function() {

			// AJAX call upon comment submittion
			$('div.comment-form form').submit(function() {
				// Remove errors from previous submittions
				$('div.comment-error').remove();
				// The rest of the function will go here.
				
				// Disable the Post button to prevent accidental duplication.
				$('#comment-post').attr('disabled', 'disabled');

				 
				 var params = $('form').serialize();
				 $.post('/ajax/comments', params, function(data) {
						if (data.status == "success") {

							// Build the returned comment
							comment_html = '<table><tr><td><div style="width:150px;"><span class="comments-names">' + data.usernick +
								'</span><BR />0 minutes ago</div></td><td>' +
								'<div style="width:500px;">' + data.commenttext + '</div></td></tr></table>'

							// Attach to the DOM
							$('#commentTable:last').prepend(comment_html);

							// Hide the comment form to prevent duplication, and
							// replace it with a success message for the user.
							$('.comment-form').hide()
								.html('<p class="comment-thanks">Comment successfully' +
									  ' posted. Thank you!</p>')
								.show();
						} else {
							// If there were errors with the form, add them to the
							// page above  "comment-error" div.
							$('div.comment-form').before('<div class="comment-error">' +
								data.error + '</div>');
						}
						// Enable submit button
						$('#comment-post').removeAttr("disabled");
				});
				return false;
			});
		});
		// Show comment form
		function ShowPost(){
			$("div.add-comment").hide();
			$("div.comment-form").show();
		}
		</script>	